package com.example.travelservlet.fans.controller;

import com.example.travelservlet.entity.DynamicDto;
import com.example.travelservlet.entity.User;
import com.example.travelservlet.fans.service.FansService;
import com.example.travelservlet.user.domain.Result;
import com.example.travelservlet.utils.ResultUtil;
import com.google.gson.Gson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

@RestController
@RequestMapping("/fans")
public class FansController {

    @Autowired
    private FansService fansService;

    @PostMapping("/findFans")
    public Result<List<User>> findFans(@Valid String loginName){
        List<User> fans = fansService.findFans(loginName);
        System.out.println(fans);
        //
        return ResultUtil.success(fans);
    }
}
